package service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import service.GoodsService;
import vo.Commodity;
import vo.Store;
import dao.GoodsDao;
@Service("gs")
public class GoodsServiceImpl implements GoodsService{
	@Autowired(required=true)
	GoodsDao gd;
	
	@Override
	@Transactional
	public int insertGoods(Commodity goods) {
		
		return gd.add(goods);
	}
	
	@Override
	@Transactional
	public void deleteGoods(int goodsId) {
		gd.deleteGoods(goodsId);
		
	}

	@Override
	public Commodity queryGoods(int goodsId) {
		
		return gd.queryGoods(goodsId);
	}
	@Transactional
	@Override
	public List<Commodity> updateGoods(Commodity goods) {
		return gd.updateGoods(goods);
	}

	@Override
	public List<Commodity> queryAllGoods(Store store) {
		return gd.queryAllGoods(store);
	}

}
